-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PhaseOracle and BooleanExpression allow setting the expression variable order #6658
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit switches the tweedledum requirement from being optional to a hard requirement for installing qiskit-terra. We rely on tweedledum to synthesize phase oracles which is commonly used functionality and several issues have been opened. This use of tweedledum will likely continue to grow so we should just list it as a requirement moving forward. We originally made it optional because the functionality depending on tweedledum was isolated to just the classical function compiler which wasn't widely used. There were also packaging issues in the past where the available precompiled binaries for tweedledum didn't support all of our supported environments, but those have been resolved. There is still an issue for arm64 macOS binaries but Qiskit doesn't have wide support for that yet (although there is a job for terra). At the same time this commit cleans up the optional requirements list so that aer is no longer listed there and we add an 'all' extra so that people can have a simple entypoint to install all the optional extras at once. Fixes Qiskit#6333 Fixes Qiskit#1253
Co-authored-by: Bruno Schmitt <[email protected]>
boschmitt
changed the title
Expression var order
PhaseOracle, expression variable order.
Jun 29, 2021
|
#6588 is on its way to be merged. So removing |
1ucian0
reviewed
Jul 1, 2021
Co-authored-by: Luciano Bello <[email protected]>
1ucian0
requested changes
Jul 1, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding some testing and reno?
1ucian0
changed the title
PhaseOracle, expression variable order.
PhaseOracle and BooleanExpression allow setting the expression variable order
Jul 2, 2021
1ucian0
added
the
Changelog: API Change
Include in the "Changed" section of the changelog
label
Jul 2, 2021
HuangJunye
added
the
Community PR
PRs from contributors that are not 'members' of the Qiskit repo
label
Jun 21, 2022
Pull Request Test Coverage Report for Build 4087465935
💛 - Coveralls |
1ucian0
reviewed
Feb 3, 2023
1ucian0
reviewed
Feb 3, 2023
1ucian0
reviewed
Feb 3, 2023
1ucian0
reviewed
Feb 3, 2023
1ucian0
reviewed
Feb 3, 2023
1ucian0
approved these changes
Feb 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
pranay1990
pushed a commit
to pranay1990/qiskit-terra
that referenced
this pull request
Feb 9, 2023
…le order (Qiskit#6658) * Make tweedledum a hard requirement This commit switches the tweedledum requirement from being optional to a hard requirement for installing qiskit-terra. We rely on tweedledum to synthesize phase oracles which is commonly used functionality and several issues have been opened. This use of tweedledum will likely continue to grow so we should just list it as a requirement moving forward. We originally made it optional because the functionality depending on tweedledum was isolated to just the classical function compiler which wasn't widely used. There were also packaging issues in the past where the available precompiled binaries for tweedledum didn't support all of our supported environments, but those have been resolved. There is still an issue for arm64 macOS binaries but Qiskit doesn't have wide support for that yet (although there is a job for terra). At the same time this commit cleans up the optional requirements list so that aer is no longer listed there and we add an 'all' extra so that people can have a simple entypoint to install all the optional extras at once. Fixes Qiskit#6333 Fixes Qiskit#1253 * Remove unused imports * Cleanup docstrings * black setup * Update requirements.txt Co-authored-by: Bruno Schmitt <[email protected]> * User defined variable order for oracle expressions * Fix lint problems * Update qiskit/circuit/classicalfunction/boolean_expression.py Co-authored-by: Luciano Bello <[email protected]> * Tests and bug-fix * black * Add reno * black * Consider order in the parameters * black --------- Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Luciano Bello <[email protected]>
This was referenced Mar 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Changelog: API Change
Include in the "Changed" section of the changelog
Community PR
PRs from contributors that are not 'members' of the Qiskit repo
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR add the ability for users to define the variable order when defining a
PhaseOracle
. This closes #6499. It depends on #6588.The result is
{'0101': 237, '1010': 271, '1011': 276, '0111': 240}
Details and comments
The default behaviour is to order variables by appearance in the expression.
Which prints the result:
{'0011': 266, '1101': 264, '1100': 241, '0111': 253}